package com.itheima.d4_algorithm;

import java.util.Arrays;

/**
 * 目标：掌握冒泡排序的编写。
 */
public class Test1 {
    public static void main(String[] args) {
        int[] arr={23,45,67,89,12,34,56,78,90};
        m(arr);
    }


    public static void m(int[] arr){
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j]>arr[j+1]){
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }

}
